package com.lw.question07;

import java.util.Scanner;

/**
 * @author LW
 * @2020/9/16 19:39
 */
public class 条件整除 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入n,且 100 ≤ n ≤10000。");
        int n = scanner.nextInt();
        int sum = 0;
        for (int i = 3; i < n; i++) {
            if (i%3==0&&i%7==0){
                sum += i;
            }
        }
        double sqrt = StrictMath.sqrt(sum);
        System.out.println(sqrt);



    }
}
